#include <cuda_test_utils.cuh>
#include <string>

class DeviceInfoTest : public CudaTest
{
public:
    void run() override
    {
        int dev = 0;
        cudaDeviceProp devProp;
        MYCHECK(cudaGetDeviceProperties(&devProp, dev));

        MYINFO("Using GPU device {0}: {1}", dev, devProp.name);
        MYINFO("Number of SMs: {0}", devProp.multiProcessorCount);
        MYINFO("Shared memory per thread block: {0:.2f} KB", devProp.sharedMemPerBlock / 1024.0);
        MYINFO("Max threads per thread block: {0}", devProp.maxThreadsPerBlock);
        MYINFO("Max threads per stream processor: {0}", devProp.maxThreadsPerMultiProcessor);
        MYINFO("Max warps per stream processor: {0}", devProp.maxThreadsPerMultiProcessor / 32);
        MYINFO("Max shared memory per stream processor: {0:.2f} KB", devProp.sharedMemPerMultiprocessor / 1024.0);
        MYINFO("Max registers per stream processor: {0}", devProp.regsPerMultiprocessor);
    }

    std::string name() const override { return "DeviceInfoTest"; }
};

REGISTER_TEST(DeviceInfoTest);